import 'package:flutter/services.dart';

///EventChannel:用于数据流(event streams)的通信，有监听功能，比如电量变化之后的数据推送给Flutter
class NoticeChannel {
  static const NOTICE_CHANNEL_NAME = "cn.xqw/notice";

  static var _eventChannel = EventChannel(NOTICE_CHANNEL_NAME);

  static initChannels(Function fun) {
    _eventChannel.receiveBroadcastStream().listen(null);
  }

  static cancel() {
    _eventChannel.receiveBroadcastStream().listen(null);
  }
}
